import request from '@/utils/axios';

import { DataSourceInfoListRS, DataSourceInfoVO } from './types';

export const listApi = (data: any) => {
  return request.post<DataSourceInfoListRS>({
    url: '/tenant/dataSourceInfo/list',
    data,
  });
};

export const getApi = (id: string) => {
  return request.get<DataSourceInfoVO>({
    url: '/tenant/dataSourceInfo/get/' + id,
  });
};

export const saveApi = (data: DataSourceInfoVO) => {
  return request.post({ url: '/tenant/dataSourceInfo/save', data });
};

export const updateApi = (data: DataSourceInfoVO) => {
  return request.post({ url: '/tenant/dataSourceInfo/update', data });
};

export const removeApi = (id?: string) => {
  return request.post({ url: '/tenant/dataSourceInfo/remove', params: { id } });
};
